import React from 'react';
import ReactDOM from 'react-dom';
import { HashRouter as Router, Route, Switch } from 'react-router-dom'
import App from './App';
import Activities from '@/components/Activities';
import book from '@/components/book/Book';
import Subscribed from '@/components/index/subscribed';
import Newentry from '@/components/index/newentry';
import Notification from '@/components/index/notification';
import Huodong from '@/components/Huodong';
import noLogin from '@/components/index/noLogin/index'
import * as serviceWorker from './serviceWorker';
import Topic from '@/components/topics/Topic';
import Topics from '@/components/topics/Topics';
import User from '@/components/user/User';
import { Provider } from 'react-redux';
import store from './store';
import './main.scss';

ReactDOM.render(
    <Provider store = { store }>
    <Router>
        <Switch>      
            <Route path='/Huodong' component = { Huodong } /> 
            <Route path='/activities' component = { Activities } />
            <Route path='/book' component = { book } />
            <Route path='/user' component = { User } />
            <Route path='/topic' component = { Topic } />
            <Route path='/topics' component = { Topics } />
            <Route path='/subscribed' component = { Subscribed } />
            <Route path='/newentry' component = { Newentry } />
            <Route path='/notification' component = { Notification } />
            <Route path ='/nologin' component = { noLogin } />
            <Route path='/' component = { App } />
        </Switch>
    </Router>
    </Provider>
    , document.getElementById('root'));

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: http://bit.ly/CRA-PWA
process.env.NODE_ENV === 'production' ? serviceWorker.register() : serviceWorker.unregister()